package com.hyperboost.backend.service.impl;

import java.util.List;
import com.hyperboost.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hyperboost.backend.mapper.OpportunityCommentMapper;
import com.hyperboost.backend.domain.OpportunityComment;
import com.hyperboost.backend.service.IOpportunityCommentService;

/**
 * 机会评论Service业务层处理
 * 
 * @author LXY
 * @date 2025-04-11
 */
@Service
public class OpportunityCommentServiceImpl implements IOpportunityCommentService 
{
    @Autowired
    private OpportunityCommentMapper opportunityCommentMapper;

    /**
     * 查询机会评论
     * 
     * @param commentId 机会评论主键
     * @return 机会评论
     */
    @Override
    public OpportunityComment selectOpportunityCommentByCommentId(Long commentId)
    {
        return opportunityCommentMapper.selectOpportunityCommentByCommentId(commentId);
    }

    /**
     * 查询机会评论列表
     * 
     * @param opportunityComment 机会评论
     * @return 机会评论
     */
    @Override
    public List<OpportunityComment> selectOpportunityCommentList(OpportunityComment opportunityComment)
    {
        return opportunityCommentMapper.selectOpportunityCommentList(opportunityComment);
    }

    /**
     * 新增机会评论
     * 
     * @param opportunityComment 机会评论
     * @return 结果
     */
    @Override
    public int insertOpportunityComment(OpportunityComment opportunityComment)
    {
        opportunityComment.setCreateTime(DateUtils.getNowDate());
        return opportunityCommentMapper.insertOpportunityComment(opportunityComment);
    }

    /**
     * 修改机会评论
     * 
     * @param opportunityComment 机会评论
     * @return 结果
     */
    @Override
    public int updateOpportunityComment(OpportunityComment opportunityComment)
    {
        opportunityComment.setUpdateTime(DateUtils.getNowDate());
        return opportunityCommentMapper.updateOpportunityComment(opportunityComment);
    }

    /**
     * 批量删除机会评论
     * 
     * @param commentIds 需要删除的机会评论主键
     * @return 结果
     */
    @Override
    public int deleteOpportunityCommentByCommentIds(Long[] commentIds)
    {
        return opportunityCommentMapper.deleteOpportunityCommentByCommentIds(commentIds);
    }

    /**
     * 删除机会评论信息
     * 
     * @param commentId 机会评论主键
     * @return 结果
     */
    @Override
    public int deleteOpportunityCommentByCommentId(Long commentId)
    {
        return opportunityCommentMapper.deleteOpportunityCommentByCommentId(commentId);
    }
}
